/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.model.bo.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

/**
 * 预期结果信息类（导入）
 *
 * @author zpy
 * @version 1.0.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExpectedResultExcelBO {

    @ExcelProperty(value = "层面指标", order = 1)
    private String layerTarget;
    @ExcelProperty(value = "测评指标", order = 2)
    private String unitTarget;
    @ExcelProperty(value = "资产分类", order = 3)
    private String assetClass;
    @ExcelProperty(value = "对象类型", order = 4)
    private String assetType;
    @ExcelProperty(value = "判定项", order = 5)
    private String evalItem;
    @ExcelProperty(value = "判定结论", order = 6)
    private String evalConclusion;
    @ExcelProperty(value = "预期结果", order = 7)
    private String result;


    public boolean isEmpty() {
        return StringUtils.isAllBlank(layerTarget, unitTarget, assetClass, assetType, evalItem, evalConclusion, result);
    }

    public boolean equals(@NonNull ExpectedResultExcelBO other) {
        return StringUtils.equals(layerTarget, other.getLayerTarget())
                && StringUtils.equals(unitTarget, other.getUnitTarget())
                && StringUtils.equals(assetClass, other.getAssetClass())
                && StringUtils.equals(assetType, other.getAssetType())
                && StringUtils.equals(evalItem, other.getEvalItem())
                && StringUtils.equals(evalConclusion, other.getEvalConclusion())
                && StringUtils.equals(result, other.getResult());
    }

}